var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var $2UIManager = require("UIManager");
var $2MenuUI = require("MenuUI");
var $2FlbDataStorageUtil = require("FlbDataStorageUtil");
var $2TaSdk = require("TaSdk");
var $2pvzChannel = require("pvzChannel");
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var def_JssjbhcUI = /* */function (_cc$Component40) {
  babel_inherits(h, _cc$Component40);
  var _super44 = babel_createSuper(h);
  function h() {
    var _this95;
    babel_classCallCheck(this, h);
    _this95 = _super44.apply(this, arguments);
    _this95.q009 = null;
    _this95.q005 = null;
    _this95.q006 = null;
    return _this95;
  }
  babel_createClass(h, [{
    key: "onLoad",
    value: function onLoad() {
      this.q009 = cc.find("q009", this.node);
      this.q005 = cc.find("q005", this.node);
      this.q006 = cc.find("q006", this.node);
      this.video = cc.find("q005/q016", this.node);
      this.video1 = cc.find("q006/q016", this.node);
      $2FlbDataStorageUtil.DataStorageUtil.getVal("jjdf", false) && (this.video.active = false);
      $2FlbDataStorageUtil.DataStorageUtil.getVal("zuqiu", false) && (this.video1.active = false);
      this.q009.on(cc.Node.EventType.TOUCH_START, this.on_close, this);
      this.q005.on(cc.Node.EventType.TOUCH_END, this.on_jjdf, this);
      this.q006.on(cc.Node.EventType.TOUCH_END, this.on_zuqiu, this);
    }
  }, {
    key: "on_zuqiu",
    value: function on_zuqiu() {
      var _this96 = this;
      if ($2FlbDataStorageUtil.DataStorageUtil.getVal("zuqiu", false)) {
        $2UIManager.default.instance.showUI("ZuqiuUI");
        return void $2UIManager.default.instance.closeUI("JssjbhcUI");
      }
      $2TaSdk.default.instance.AdsButtonClick($2TaSdk.VideoIndex.zuqiu);
      $2pvzChannel.pvzChannel.instance().showVideo({
        sucCall() {
          _this96.getreward1();
        },
        failCall() {},
        endCall() {}
      });
    }
  }, {
    key: "on_jjdf",
    value: function on_jjdf() {
      var _this97 = this;
      if ($2FlbDataStorageUtil.DataStorageUtil.getVal("jjdf", false)) {
        $2UIManager.default.instance.showUI("JiujiudaifuUI");
        return void $2UIManager.default.instance.closeUI("JssjbhcUI");
      }
      $2TaSdk.default.instance.AdsButtonClick($2TaSdk.VideoIndex.jjdf);
      $2pvzChannel.pvzChannel.instance().showVideo({
        sucCall() {
          _this97.getreward();
        },
        failCall() {},
        endCall() {}
      });
    }
  }, {
    key: "getreward",
    value: function getreward() {
      $2FlbDataStorageUtil.DataStorageUtil.setVal("jjdf", true);
      this.video.active = false;
      $2UIManager.default.instance.showUI("JiujiudaifuUI");
      $2UIManager.default.instance.closeUI("JssjbhcUI");
    }
  }, {
    key: "getreward1",
    value: function getreward1() {
      $2FlbDataStorageUtil.DataStorageUtil.setVal("zuqiu", true);
      this.video1.active = false;
      $2UIManager.default.instance.showUI("ZuqiuUI");
      $2UIManager.default.instance.closeUI("JssjbhcUI");
    }
  }, {
    key: "on_close",
    value: function on_close() {
      $2UIManager.default.instance.closeUI("JssjbhcUI");
      $2UIManager.default.instance.uiList.MenuUI.getComponent($2MenuUI.default).showNode();
    }
  }]);
  return h;
}(cc.Component);
def_JssjbhcUI = cc__decorate([ccp_ccclass], def_JssjbhcUI);
exports.default = def_JssjbhcUI;